package com.nbsaas.boot.site.rest.resource;

import com.nbsaas.boot.site.api.apis.DynamicPageApi;
import com.nbsaas.boot.site.data.entity.DynamicPage;
import com.nbsaas.boot.site.api.domain.request.DynamicPageRequest;
import com.nbsaas.boot.site.api.domain.response.DynamicPageResponse;
import com.nbsaas.boot.site.api.domain.simple.DynamicPageSimple;
import com.nbsaas.boot.site.rest.convert.DynamicPageSimpleConvert;
import com.nbsaas.boot.site.rest.convert.DynamicPageEntityConvert;
import com.nbsaas.boot.site.rest.convert.DynamicPageResponseConvert;
import com.nbsaas.boot.site.data.repository.DynamicPageRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   -业务接口实现
*/
@Transactional
@Service
public class DynamicPageResource extends BaseResource<DynamicPage,DynamicPageResponse, DynamicPageSimple, DynamicPageRequest>  implements DynamicPageApi {

    @Resource
    private DynamicPageRepository dynamicPageRepository;

    @Override
    public JpaRepositoryImplementation<DynamicPage, Serializable> getJpaRepository() {
        return dynamicPageRepository;
    }

    @Override
    public Function<DynamicPage, DynamicPageSimple> getConvertSimple() {
        return new DynamicPageSimpleConvert();
    }

    @Override
    public Function<DynamicPageRequest, DynamicPage> getConvertForm() {
        return new DynamicPageEntityConvert();
    }

    @Override
    public Function<DynamicPage, DynamicPageResponse> getConvertResponse() {
        return new DynamicPageResponseConvert();
    }




}


